package Pages;

import appium1.common.Helper;
import org.openqa.selenium.WebElement;

public class PageNewsDetail {
    private Helper helper;

    public PageNewsDetail(Helper helper) {
        this.helper = helper;
    }

    public WebElement getAddToFavoriteBtn() {
        return helper.findById("net.oschina.app:id/ib_fav");
    }

    public WebElement getShareBtn() {
        return helper.findById("net.oschina.app:id/menu_share");
    }

    public WebElement getBackBtn() {
        return helper.findByClassName("android.widget.ImageButton");
    }

    public WebElement getSharetoQQ(){
        return helper.findById("net.oschina.app:id/ll_share_qq");
    }

    public WebElement getShareWechatGroup(int index) {
        return helper.findByClassName("android.widget.LinearLayout",index);
    }

    public void clickBackBtn() {
        helper.click(getBackBtn());
    }

    public void clickAddtoFavoriBtn() {
        helper.click(getAddToFavoriteBtn());
    }

    public void clickShareBtn() {
        helper.click(getShareBtn());
    }

    public void clickShareWechatGroup(int index) {
        helper.click(getShareWechatGroup(index));
    }

    public void clickShreqq(){
        helper.click(getSharetoQQ());
    }
}
